package com.betterjr.common.web;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @ClassName: AjaxRemoteApiParam 
 * @Description: 远程调用接口参数封装
 * @author xuyp
 * @date 2018年7月6日 下午4:14:50 
 *
 */

/** 
 * @Fields serialVersionUID : 
 */

public class AjaxRemoteApiParam implements Serializable {

    private static final String ISLOGIN = "1";

    private static final long serialVersionUID = -1060261684468777350L;

    /**
     * 请求代码
     */
    private String apiCode;

    /**
     * 客户标识
     */
    private String custIdentifition;

    /**
     * 平台类型
     */
    private String servicerType;

    /**
     * 用户代码
     */
    private String userCode;

    /**
     * 同步登录  1 。同步    0 不同步
     */
    private String loginStatus;

    private Map<String, Object> paramMap = new HashMap<String, Object>();

    public String getApiCode() {
        return apiCode;
    }

    public void setApiCode(String apiCode) {
        this.apiCode = apiCode;
    }

    public String getCustIdentifition() {
        return custIdentifition;
    }

    public void setCustIdentifition(String custIdentifition) {
        this.custIdentifition = custIdentifition;
    }

    public String getServicerType() {
        return servicerType;
    }

    public void setServicerType(String servicerType) {
        this.servicerType = servicerType;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public Map<String, Object> getParamMap() {
        return paramMap;
    }

    public void setParamMap(Map<String, Object> paramMap) {
        this.paramMap = paramMap;
    }

    public String getLoginStatus() {
        return loginStatus;
    }

    public void setLoginStatus(String loginStatus) {
        this.loginStatus = loginStatus;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((apiCode == null) ? 0 : apiCode.hashCode());
        result = prime * result + ((custIdentifition == null) ? 0 : custIdentifition.hashCode());
        result = prime * result + ((loginStatus == null) ? 0 : loginStatus.hashCode());
        result = prime * result + ((paramMap == null) ? 0 : paramMap.hashCode());
        result = prime * result + ((servicerType == null) ? 0 : servicerType.hashCode());
        result = prime * result + ((userCode == null) ? 0 : userCode.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof AjaxRemoteApiParam)) {
            return false;
        }
        AjaxRemoteApiParam other = (AjaxRemoteApiParam) obj;
        if (apiCode == null) {
            if (other.apiCode != null) {
                return false;
            }
        } else if (!apiCode.equals(other.apiCode)) {
            return false;
        }
        if (custIdentifition == null) {
            if (other.custIdentifition != null) {
                return false;
            }
        } else if (!custIdentifition.equals(other.custIdentifition)) {
            return false;
        }
        if (loginStatus == null) {
            if (other.loginStatus != null) {
                return false;
            }
        } else if (!loginStatus.equals(other.loginStatus)) {
            return false;
        }
        if (paramMap == null) {
            if (other.paramMap != null) {
                return false;
            }
        } else if (!paramMap.equals(other.paramMap)) {
            return false;
        }
        if (servicerType == null) {
            if (other.servicerType != null) {
                return false;
            }
        } else if (!servicerType.equals(other.servicerType)) {
            return false;
        }
        if (userCode == null) {
            if (other.userCode != null) {
                return false;
            }
        } else if (!userCode.equals(other.userCode)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "AjaxRemoteApiParam [apiCode=" + apiCode + ", custIdentifition=" + custIdentifition + ", servicerType="
                + servicerType + ", userCode=" + userCode + ", loginStatus=" + loginStatus + ", paramMap=" + paramMap
                + "]";
    }

    /**
     * 
     * @Title: isLogin 
     * @Description: 是否登录 
     * @return TODO(说明)
     * @throws 
     * @author xuyp
     * @date 2018年7月7日 下午2:29:16
     */
    public boolean isLogin() {

        if (ISLOGIN.equals(getLoginStatus())) {
            return true;
        }

        return false;

    }

}
